<template>
    <div class="c-row" :style="styles"><slot></slot></div>
</template>

<script>
    export default {
        name: "CRow",
        props: {
            // c-col之间的间距
            gutter: {
                type: [Number, String],
                default: 0,
            }
        },
        data() {
            return {};
        },
        computed: {
            styles() {
                if (this.gutter > 0) {
                    return {
                        marginLeft: this.gutter / -2 + 'px',
                        marginRight: this.gutter / -2 + 'px',
                    };
                }
                return {};
            }
        },
        methods: {}
    };
</script>

<style lang="less">
    .c-row {
        &:after {
            display: block;
            content: '';
            clear: both;
        }
    }
</style>
